-
Couldn't load subscription status.
- Fork 122
staticaddr: channel funding with deposits #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
60286d0 to
97049c1
Compare
6c330e5 to
4184f2d
Compare
fbe14d2 to
59975f0
Compare
|
Rebased |
59975f0 to
596b1df
Compare
|
Rebased |
596b1df to
4d0e787
Compare
|
Rebased master |
4d0e787 to
818b915
Compare
|
Rebased master. |
818b915 to
c4dc989
Compare
bf7bd29 to
7bd2fd0
Compare
|
Rebased with latest master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started reviewing the PR.
I propose to dedup channel open related proto types with LND, see hieblmi#2
| @@ -0,0 +1,134 @@ | |||
| package staticutil | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-ascii characters in the commit message. I think we can remove it.
| ) | ||
|
|
||
| // ToPrevOuts converts a slice of deposits to a map of outpoints to TxOuts. | ||
| func ToPrevOuts(deposits []*deposit.Deposit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to cover the function with unit tests.
| ) | ||
| } | ||
|
|
||
| func (m *Manager) toPrevOuts(deposits []*deposit.Deposit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method reuse staticutil.ToPrevOuts?
Also we have loopin.StaticAddressLoopIn.toPrevOuts method. I guess it should also reuse staticutil.ToPrevOuts, right?
| signer lndclient.SignerClient, deposits []*deposit.Deposit, | ||
| addrParams *address.Parameters, | ||
| staticAddress *script.StaticAddress) ([]*input.MuSig2SessionInfo, | ||
| [][]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to cover the function with unit tests.
| } | ||
|
|
||
| // CreateMusig2Sessions creates a musig2 session for a number of deposits. | ||
| func CreateMusig2Sessions(ctx context.Context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse this function in loopin.StaticAddressLoopIn.createMusig2Sessions?
| returns (StaticAddressSummaryResponse); | ||
|
|
||
| /* loop:`static` | ||
| /* loop:`in` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe static in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIxed in hieblmi#2
| rpc StaticAddressLoopIn (StaticAddressLoopInRequest) | ||
| returns (StaticAddressLoopInResponse); | ||
|
|
||
| /* loop:`openchannel` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static openchannel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in hieblmi#2
| /* | ||
| An optional error string. | ||
| */ | ||
| string error = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we deliver errors via gRPC errors?
| uint64 asset_cost_offchain = 3; | ||
| } | ||
|
|
||
| message OpenChannelRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL at hieblmi#2
I removed all the code below this line from this file and used the original LND types from lntypes.
� Conflicts: � staticaddr/utils.go
a0fe637 to
706c1ff
Compare
This PR introduces a
openchannelsubcommand to static addresses.It provides the same experience as
lncli openchannel.Exmples:
Open a channel with all available deposits:
Open a channel with specified local funding amount, coin-selected from available deposits under fee and dust considerations.
Open a channel from two deposits AAA and BBB while taking their combined value(fundmax) as funding amount and considering fees and dust limit.
Open a channel from two deposits AAA and BBB while taking a specified amount(local_amt) as funding amount and considering fees and dust limit.
TODOs: